*** medio ambiente vs. the economy ***
generate env1eco7 = I1
recode env1eco7 (1=1)(2=2)(3=3)(4=4)(5=5)(6=6)(7=7)(99=.)

*** local government vs. NGO ***
tab E4
generate protection = E4
recode protection (1=0)(2=1)(3.=.)(99=.)

*** social conditions ***
*** water quality ***
tab C2a
generate waterqua = C2a
recode waterqua (1=1)(2=2)(3=3)(4=4)(5=5)(6=6)(7=7)(99=.)(-1=.)
*** cooking ***
tab C3
generate cooking = C3
recode cooking (1=1)(2=0)(3=.)(99=.)
*** electricity ***
tab C1a
generate electricity=.
replace electricity=0 if C1a >= 1 & C1a <= 23
replace electricity=1 if C1a==24
*** education ***
tab A4a
generate education=.
replace education=1 if A4a == 1
replace education=2 if A4a >= 2 & A4a <= 3
replace education=3 if A4a >= 4 & A4a <= 5
replace education=4 if A4a >= 6 & A4a <= 9
*** remittances***
tab D11
generate remittances = D11
recode remittances (1=1)(2=0)(99=.)

*** social community  ****
tab G7
generate soctrust = G7
recode soctrust (1=1)(2=1)(3=0)(4=0)(99=.)
tab F1
generate talkdisaster = F1
recode talkdisaster (1=4)(2=3)(3=2)(4=1)(5=0)(99=.)
tab F8a
generate efficaydisaster = F8a
recode efficaydisaster (1=1)(2=1)(3=.)(4=0)(5=0)(99=.)
tab F8b
generate commresponse = F8b
recode commresponse (1=1)(2=1)(3=.)(4=0)(5=0)(99=.)
tab H1
generate commhelp = H1
tab commhelp

*** institutions trust ***
tab G5a
generate trustrebuild = G5a
recode trustrebuild (1=4)(2=3)(3=2)(4=2)(5=1)(99=.)
tab G5c
generate trustrelocate = G5c
recode trustrelocate (1=4)(2=3)(3=2)(4=2)(5=1)(99=.)

**** trust government institutions ***
tab G1a
generate justice = G1a
recode justice (1=1)(2=2)(3=3)(4=4)(5=5)(6=6)(7=7)(99=.)
tab G1c
generate congress = G1c
recode congress (1=1)(2=2)(3=3)(4=4)(5=5)(6=6)(7=7)(99=.)
tab G1e 
generate parties = G1e
recode parties (1=1)(2=2)(3=3)(4=4)(5=5)(6=6)(7=7)(99=.)
tab G1f
generate president = G1f
recode president (1=1)(2=2)(3=3)(4=4)(5=5)(6=6)(7=7)(99=.)
tab G1h
generate municipal = G1h
recode municipal (1=1)(2=2)(3=3)(4=4)(5=5)(6=6)(7=7)(99=.)
generate govertrust = justice+congress+parties+president+municipal
*** government trust index ***
generate govertrust_100=round(((govertrust/35)*100))
tab  



*** trust social organizations / leaders ***



*** performance ***
recode F5a (1=1)(2=0)(99=.)
recode F5b (1=1)(2=0)(99=.)
recode F5c (1=1)(2=0)(99=.)
recode F5d (1=1)(2=0)(99=.)
generate performance = F5a+F5b+F5c+F5d

*** vulnerability ***
tab D2
generate flood = D2
recode flood (6=0)(1=1)(2=2)(3=.)(4=3)(5=4)(99=.)
tab D3
generate drought = D3
recode drought (6=0)(1=1)(2=2)(3=.)(4=3)(5=4)(99=.)

*** natural disasters ***
recode D4a (1=1)(2=0)(99=.)
recode D4c (1=1)(2=0)(99=.)
recode D4d (1=1)(2=0)(99=.)
recode D4e (1=1)(2=0)(99=.)
recode D4g (1=1)(2=0)(99=.)
generate natdisasters = D4a+D4c+D4d+D4e+D4g

*** damages ***
recode D5 (1=1)(2=0)(99=.)
recode D6 (1=1)(2=0)(99=.)
recode D7 (1=1)(2=0)(99=.)
recode D8 (1=1)(2=0)(99=.)
generate damages = D5+D6+D7+D8

*** migration ***

*** importance of climate ***
tab E2b
generate climateimpor = E2b 
recode climateimpor (-1=.)(1=1)(2=2)(3=.)(4=3)(5=4)(99=.)

*** concern / worried about climate ***
tab E2c
generate climateworry = E2c 
recode climateworry (-1=.)(1=1)(2=2)(3=.)(4=3)(5=4)(99=.)

*** think about the environment
tab E6b
generate climatethink = E6b
recode climatethink (1=1)(2=2)(3=3)(99=.)
						   
						   
**Gender*						   
recode A1 (1=1 "woman") (2=0 "man") (.=.), gen (A1_gender)

recode D1 (1=1) (2=0) (99=.)

*** vulnerability ***
tab D2
recode D2 (6=0 "no flood")(1=1 "much less flood")(2=2 "less flood")(3=.) (4=3 "more flood")(5=4 "much more flood")(99=.), gen (D2_flood)
tab D3
recode D3 (6=0 "no drought")(1=1 "much less drought")(2=2 "less drought")(3=.)(4=3 "more drought")(5=4 "much more drought")(99=.), generate (D3_drought)

*** natural disasters ?? ***
recode D4a (1=1)(2=0)(99=.)
recode D4c (1=1)(2=0)(99=.)
recode D4d (1=1)(2=0)(99=.)
recode D4e (1=1)(2=0)(99=.)
recode D4g (1=1)(2=0)(99=.)
generate natdisasters = D4a+D4c+D4d+D4e+D4g

*** damages ***
recode D5 (1=1)(2=0)(99=.)
recode D6 (1=1)(2=0)(99=.)
recode D7 (1=1)(2=0)(99=.)
recode D8 (1=1)(2=0)(99=.)
generate damages = D5+D6+D7+D8

*** migration ***
recode D14 (1=3 "more people migrated") (2=2 "less people migrated") (3=0 "no one migrated") (99=.), gen (D14_migration)
recode D15 (1=1 "no one migrated") (2=2 "few people migrated") (3=3 "a lot of people migrated") (99=.), gen (D115_permanentmigration)

*** concern / worried about climate ***
tab E2c
recode E2c (-1=.)(1=1 "not at all")(2=2 "a little")(3=.)(4=3 "worried")(5=4 "a lot")(99=.), gen (E2c_climateworry)

tab F1
recode F1 (1=4 "more than once a week")(2=3 "once a week")(3=2 "once a month")(4=1 "once or twice a year")(5=0 "never")(99=.), gen (F1_talkdisaster)

*** performance ? ***
recode F5a (1=1)(2=0)(99=.)
recode F5b (1=1)(2=0)(99=.)
recode F5c (1=1)(2=0)(99=.)
recode F5d (1=1)(2=0)(99=.)
generate performance = F5a+F5b+F5c+F5d

*serious threat
recode F10b (1=4 "very much agree") (2=3 "agree") (3=.) (4=2 "somewhat disagree") (5=1 "very much disagree") (99=.), gen (F10b_clichngseriousthreat)

**** trust government institutions ***
tab G1a
generate G1a_justice = G1a
recode G1a_justice (1=1)(2=2)(3=3)(4=4)(5=5)(6=6)(7=7)(99=.)
tab G1c
generate G1c_congress = G1c
recode G1c_congress (1=1)(2=2)(3=3)(4=4)(5=5)(6=6)(7=7)(99=.)
tab G1e 
generate G1e_parties = G1e
recode G1e_parties (1=1)(2=2)(3=3)(4=4)(5=5)(6=6)(7=7)(99=.)
tab G1f
generate G1f_president = G1f
recode G1f_president (1=1)(2=2)(3=3)(4=4)(5=5)(6=6)(7=7)(99=.)
tab G1h
generate G1h_municipal = G1h
recode G1h_municipal (1=1)(2=2)(3=3)(4=4)(5=5)(6=6)(7=7)(99=.)
generate govertrust = G1a_justice+G1c_congress+G1e_parties+G1f_president+G1h_municipal

*** government trust index ***
generate govertrust_100=round(((govertrust/35)*100))
tab govertrust_100

*corruption
recode G2 (1=4 "very true") (2=3 "true") (3=.) (4=2 "false") (5=1 "very false") (99=.), gen (G2_corruption)

**community help
recode H1 (1=1 "community help") (2=0 "no community help") (99=.), gen(H1_commhelp)

*** education ***
tab A4a
generate education=.
replace education=1 if A4a == 1
replace education=2 if A4a >= 2 & A4a <= 3
replace education=3 if A4a >= 4 & A4a <= 5
replace education=4 if A4a >= 6 & A4a <= 9

recode J1 (1=1 "yes") (2=0 "no") (99=.), gen(J1_natdishelp)
recode J2 (1=1 "yes") (2=0 "no") (99=.), gen(J2_infrastructure)

recode K1 (1=1 "confident") (2=0 "not confident") (99=.), gen(K1_govprotect)
tab K2, gen (lawsprotect)

*****
gen lawprotection= K2_lawsprotect_traditionallyvuln+ K2_lawsprotect_disadvantaged+ K2_lawsprotect_climatevulnerable+ K2_lawsprotect_citizens

recode K3a (1=5 "extremely important") (2=4 "very important") (3=3 "moderately important") (4=2 "slightly important") (5=1 "not important") (99=.), gen(K3a_waterright)
recode K3b (1=5 "extremely important") (2=4 "very important") (3=3 "moderately important") (4=2 "slightly important") (5=1 "not important") (99=.), gen(K3b_vulncitizright)
recode K3c (1=5 "extremely important") (2=4 "very important") (3=3 "moderately important") (4=2 "slightly important") (5=1 "not important") (99=.), gen(K3c_relocateright)
recode K3d (1=5 "extremely important") (2=4 "very important") (3=3 "moderately important") (4=2 "slightly important") (5=1 "not important") (99=.), gen(K3d_compensationright)
recode K3e (1=5 "extremely important") (2=4 "very important") (3=3 "moderately important") (4=2 "slightly important") (5=1 "not important") (99=.), gen(K3e_participationright)
recode K3f (1=5 "extremely important") (2=4 "very important") (3=3 "moderately important") (4=2 "slightly important") (5=1 "not important") (99=.), gen(K3f_consultationright)
recode K3g (1=5 "extremely important") (2=4 "very important") (3=3 "moderately important") (4=2 "slightly important") (5=1 "not important") (99=.), gen(K3g_consentright)

tab K4, gen (K4_dummies)
recode K5 (1=1 "stricter climate laws") (2=0 "less strict climate laws") (3=.) (99=.), gen (K5_strictclimatelaws)

recode MUESTRA (1=1 "national") (2=2 "flood zone") (3=3 "drough zone"), gen(Sample)

recode C1 (1=1 "yes") (2=0 "no") (99=.), gen (powergrid)
recode C2 (1=1 "yes") (2=0 "no") (99=.), gen (drinkingwater)

recode A6 (1=1 "yes") (2=0 "no") (99=.), gen (A6_economicproblems)
recode A7_O1 (-1=.) (1/2=0 "other") (3=1 "buyingfood") (4/9=0 "other") (99=.), gen (A7_economicproblem_food2) 

recode A5 (1=1 "agricultural worker") (2/11=0 "other") (99=.), gen (A5_agriculturalworker)
recode G1l (1=1)(2=2)(3=3)(4=4)(5=5)(6=6)(7=7)(99=.), gen (G1l_trustCOCODE)
recode G1r (1=1)(2=2)(3=3)(4=4)(5=5)(6=6)(7=7)(99=.), gen (G1r_trustsugarmills)
recode P204 (1=1) (2=2) (3=3)(4=4)(5=5)(6=6)(7=7)(99=.), gen (P204_income)
recode G1m (1=1)(2=2)(3=3)(4=4)(5=5)(6=6)(7=7)(99=.), gen (G1m_trustNGOs)
recode G1q (1=1)(2=2)(3=3)(4=4)(5=5)(6=6)(7=7)(99=.), gen (G1q_trustbuisness)


************ Replication Commands: "Trust in Government" in Hot Water: Obstacles to Effective Disaster Relief and Climate Adaptation Policy in Guatemala

*Table 1
logit F5a D2_flood D3_drought D5 D6 D7 natdisasters_econloss govertrust_100 G2_corruption H3_goveffectivebasicgoods K1_govprotectenviron I2_seriousproblemfuture A1_gender C1_powergrid C2_drinkingwater P204_income

logit F5b D2_flood D3_drought D5 D6 D7 natdisasters_econloss govertrust_100 G2_corruption H3_goveffectivebasicgoods K1_govprotectenviron I2_seriousproblemfuture A1_gender C1_powergrid C2_drinkingwater P204_income

logit F5c D2_flood D3_drought D5 D6 D7 natdisasters_econloss govertrust_100 G2_corruption H3_goveffectivebasicgoods K1_govprotectenviron I2_seriousproblemfuture A1_gender C1_powergrid C2_drinkingwater P204_income

logit F5d D2_flood D3_drought D5 D6 D7 natdisasters_econloss govertrust_100 G2_corruption H3_goveffectivebasicgoods K1_govprotectenviron I2_seriousproblemfuture A1_gender C1_powergrid C2_drinkingwater P204_income

oprobit performance D2_flood D3_drought D5 D6 D7 natdisasters_econloss govertrust_100 G2_corruption H3_goveffectivebasicgoods K1_govprotectenviron I2_seriousproblemfuture A1_gender C1_powergrid C2_drinkingwater P204_income


*Table 2
oprobit J1a_qualityofhelp D2_flood D3_drought D5 D6 D7 natdisasters_econloss govertrust_100 G2_corruption H3_goveffectivebasicgoods K1_govprotectenviron I2_seriousproblemfuture A1_gender C1_powergrid C2_drinkingwater P204_income

oprobit J1b_disasterreliefsatis D2_flood D3_drought D5 D6 D7 natdisasters_econloss govertrust_100 G2_corruption H3_goveffectivebasicgoods K1_govprotectenviron I2_seriousproblemfuture A1_gender C1_powergrid C2_drinkingwater P204_income

oprobit J2a_infrasatis D2_flood D3_drought D5 D6 D7 natdisasters_econloss govertrust_100 G2_corruption H3_goveffectivebasicgoods K1_govprotectenviron I2_seriousproblemfuture A1_gender C1_powergrid C2_drinkingwater P204_income

***Multicollinearity test: High correlation coefficients (e.g., above 0.8 or 0.9) suggest multicollinearity. 
pwcorr J1a_qualityofhelp D2_flood D3_drought D5 D6 D7 natdisasters_econloss govertrust_100 G2_corruption H3_goveffectivebasicgoods K1_govprotectenviron I2_seriousproblemfuture A1_gender C1_powergrid C2_drinkingwater P204_income

pwcorr performance D2_flood D3_drought D5 D6 D7 natdisasters_econloss govertrust_100 G2_corruption H3_goveffectivebasicgoods K1_govprotectenviron I2_seriousproblemfuture A1_gender C1_powergrid C2_drinkingwater P204_income

**Robustness: Using Climate Worry variable instead future worry
oprobit J1a_qualityofhelp D2_flood D3_drought D5 D6 D7 natdisasters_econloss govertrust_100 G2_corruption H3_goveffectivebasicgoods K1_govprotectenviron E2c_climateworry A1_gender C1_powergrid C2_drinkingwater P204_income

oprobit J1b_disasterreliefsatis D2_flood D3_drought D5 D6 D7 natdisasters_econloss govertrust_100 G2_corruption H3_goveffectivebasicgoods K1_govprotectenviron E2c_climateworry A1_gender C1_powergrid C2_drinkingwater P204_income

oprobit J2a_infrasatis D2_flood D3_drought D5 D6 D7 natdisasters_econloss govertrust_100 G2_corruption H3_goveffectivebasicgoods K1_govprotectenviron E2c_climateworry A1_gender C1_powergrid C2_drinkingwater P204_income


logit F5a D2_flood D3_drought D5 D6 D7 natdisasters_econloss govertrust_100 G2_corruption H3_goveffectivebasicgoods K1_govprotectenviron E2c_climateworry A1_gender C1_powergrid C2_drinkingwater P204_income

logit F5b D2_flood D3_drought D5 D6 D7 natdisasters_econloss govertrust_100 G2_corruption H3_goveffectivebasicgoods K1_govprotectenviron E2c_climateworry A1_gender C1_powergrid C2_drinkingwater P204_income

logit F5c D2_flood D3_drought D5 D6 D7 natdisasters_econloss govertrust_100 G2_corruption H3_goveffectivebasicgoods K1_govprotectenviron E2c_climateworry A1_gender C1_powergrid C2_drinkingwater P204_income

logit F5d D2_flood D3_drought D5 D6 D7 natdisasters_econloss govertrust_100 G2_corruption H3_goveffectivebasicgoods K1_govprotectenviron E2c_climateworry A1_gender C1_powergrid C2_drinkingwater P204_income

oprobit performance D2_flood D3_drought D5 D6 D7 natdisasters_econloss govertrust_100 G2_corruption H3_goveffectivebasicgoods K1_govprotectenviron E2c_climateworry A1_gender C1_powergrid C2_drinkingwater P204_income

